import { baseUrlApi, requestClient, type Result } from '#/api/request';

/** 数据表列表 */
export const getList = () => {
  return requestClient.get<Result>(baseUrlApi('/admin/backup/index'));
};
/** 备份列表 */
export function getBackupList() {
  return requestClient.get<Result>(baseUrlApi('/admin/backup/getBackupList'));
}

export function getSetting() {
  return requestClient.get<Result>(baseUrlApi('/admin/backup/setting'));
}

export function settingPost(data: any) {
  return requestClient.post<Result>(
    baseUrlApi('/admin/backup/settingPost'),
    data,
  );
}

export function downBackup(data: any) {
  return requestClient.post<Result>(
    baseUrlApi('/admin/backup/downBackup'),
    data,
  );
}

export function recoveryBackup(data: any) {
  return requestClient.put<Result>(
    baseUrlApi('/admin/backup/recoveryBackup'),
    data,
  );
}

export function deleteBackup(data: any) {
  return requestClient.put<Result>(
    baseUrlApi('/admin/backup/deleteBackup'),
    data,
  );
}

export function deleteField(data: any) {
  return requestClient.post<Result>(
    baseUrlApi('/admin/backup/deleteField'),
    data,
  );
}

export function doAction(data: any) {
  return requestClient.post<Result>(baseUrlApi('/admin/backup/doAction'), data);
}

export function doBackup(data: any) {
  return requestClient.post<Result>(baseUrlApi('/admin/backup/doBackup'), data);
}

export function tbjg(data: any) {
  return requestClient.post<Result>(baseUrlApi('/admin/backup/tbjg'), data);
}

export function editPost(data: any) {
  return requestClient.post<Result>(baseUrlApi('/admin/backup/editPost'), data);
}
